<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>活动信息</title>
<%@ include file="/page/include.jsp"%>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/statics/plugins/bootstrap-switch/bootstrap-switch.min.css" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/statics/plugins/bootstrap-daterangepicker/daterangepicker.css" />
<link rel="stylesheet" href="<%=basePath%>/statics/css/webform.css?v=20180104" />
<script src="<%=basePath%>/statics/js/webform.js" type="text/javascript"></script>
<style type="text/css">
.form-group .btn {
	margin-bottom: 0px !important;
}
</style>
</head>
<body class="nav-md" style="background-color: #f7f7f7">
	<div class="container body">
		<div class="main_container">
			<div class="framebody" style="min-height: 100%;" role="main">
				<!-- <blockquote class="ui-elem-quote">活动信息编辑</blockquote> -->
				<div class="row">
					<div class="col-md-12 col-sm-12 col-xs-12">
						<div class="x_panel">
							<div class="x_content">
								<form class="form-horizontal form-label-left" name="promotionForm" id="promotionForm" method="post"
									action="${pageContext.request.contextPath}/promotion/savePromotion">
									<input type="hidden" id="id" name="id" value="${promotion.id }">
									<div class="item form-group">
										<label class="control-label col-md-1 col-sm-1 col-xs-1" for="promotionCode"><span class="required"><font
												color="red">*</font></span>活动编码: 
										</label>
										<div class="col-md-11 col-sm-11 col-xs-11" style="padding-top: 6px;">
											${promotion.promotionCode } <input id="promotionCode" name="promotionCode"
												value="${promotion.promotionCode }" class="form-control col-md-6 col-xs-6" type="hidden">
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-1 col-sm-1 col-xs-1" for="promotionType"><span class="required"><font
												color="red">*</font></span>活动类型: 
										</label>
										<div class="col-md-11 col-sm-11 col-xs-11">
											<c:forEach items="${promotionTypeList }" var="type">
												<label class="control-label" for="promotionType" style="margin-right:50px;">
													<input name="promotionType" value="${type.keyValue }" type="radio"
														<c:if test="${promotion.promotionType == type.keyValue }"> checked="true" </c:if>
														onclick="javascript: doShowRule(${type.keyValue });"  class="form-control">
													${type.keyIntro }
												</label>
											</c:forEach>
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-1 col-sm-1 col-xs-1" for="promotionName"><span class="required"><font
												color="red">*</font></span>活动名称: 
										</label>
										<div class="col-md-11 col-sm-11 col-xs-11">
											<input id="promotionName" name="promotionName" value="${promotion.promotionName }"
												class="form-control col-md-6 col-xs-6" type="text" placeholder="请输入活动名称" style="width: 40%;margin-right: 5px;">
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-1 col-sm-1 col-xs-1" for="promotionTitle"><span class="required"><font
												color="red">*</font></span>活动标语: 
										</label>
										<div class="col-md-11 col-sm-11 col-xs-11">
											<input id="promotionTitle" name="promotionTitle" value="${promotion.promotionTitle }"
												class="form-control col-md-6 col-xs-6" type="text" placeholder="请输入活动标语" style="width: 40%;margin-right: 5px;">
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-1 col-sm-1 col-xs-1" for="promotionDate"><span class="required"><font
												color="red">*</font></span>活动时间: </label>
										<div class="col-md-11 col-sm-11 col-xs-11">
											<i class="glyphicon glyphicon-calendar fa fa-calendar" style="margin-left: -20px; padding-top: 10px; z-index: 10; margin-right: 10px;"></i>
											<input id="promotionDate" name="promotionDate" value="${promotionDate }"
												class="form-control col-md-6 col-xs-6" type="text" placeholder="请选择活动起止时间" style="width: 40%;"> 
											<input type="hidden" id="begin" value="<fmt:formatDate value="${promotion.beginTime }" type="both" />">
											<input type="hidden" id="end" value="<fmt:formatDate value="${promotion.endTime }" type="both" />">
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-1 col-sm-1 col-xs-1" for="btnAddProduct"><span class="required"> <font
												color="red">*</font></span>活动商品:</label> 
										<div class="col-md-11 col-sm-11 col-xs-11">
											<button id="btnAddProduct" type="button" class="btn btn-success btn-sm"
												onclick="javascript: openProWin('productTable');">添加商品</button>
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-1 col-sm-1 col-xs-1" for="productTable">&nbsp;</label>
										<div class="col-md-11 col-sm-11 col-xs-11">
											<table id="productTable" class="table"></table>
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-1 col-sm-1 col-xs-1" for="btnAddTarget"><span class="required"> <font
												color="red">*</font></span>活动对象:</label> 
										<div class="col-md-11 col-sm-11 col-xs-11">
											<button id="btnAddTarget" type="button" class="btn btn-success btn-sm" onclick="javascript: openTargetWin();">选择对象</button>
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-1 col-sm-1 col-xs-1" for="promotionTargetDiv">&nbsp;</label>
										<div class="col-md-11 col-sm-11 col-xs-11">
											<div class="target" id="promotionTargetDiv">
												<div class="selectedTargetDiv">
													<dl class="selectedTargetDL" style="border-bottom: none;">
														<dd>
															<ul class="selectedTargetUL">
																<c:forEach items="${targetList}" var="target" varStatus="t">
																	<li class="targetLi${t.index }" title="${target.customerCustomId }#${target.propertyValue }#${target.propertyName }">
																		<a href="javascript:void(0)">
																			<b id="filter_name">${target.targetTypeName }</b>：
																			<b id="filter_value" class="color">${target.propertyName}</b>
																			<i id="${target.customerCustomId }" name="close_filter" onclick="javascript: delTarget('targetLi${t.index }')">×</i>
																		</a>
																	</li>
																</c:forEach>
															</ul>
														</dd>
													</dl>
												</div>
											</div>
										</div>
									</div>
									<!-- 活动规则模块 begin -->
									<%-- 定义活动规则DIV 隐藏或者显示 begin --%>
									<c:set var="ruleReduceDisplay" value="none"></c:set><%-- 满减DIV --%>
									<c:set var="ruleGiftDisplay" value="none"></c:set><%-- 满赠DIV --%>
									<c:set var="ruleDiscountDisplay" value="none"></c:set><%-- 折扣DIV --%>
									<c:choose>
										<c:when test="${promotionType == 1 }">
											<c:set var="ruleReduceDisplay" value="block"></c:set>
										</c:when>
										<c:when test="${promotionType == 2 }">
											<c:set var="ruleGiftDisplay" value="block"></c:set>
										</c:when>
										<c:otherwise>
											<c:set var="ruleDiscountDisplay" value="block"></c:set>
										</c:otherwise>
									</c:choose>
									<%-- 定义活动规则DIV 隐藏或者显示 end --%>
									
									<%-- 满减规则添加按钮 隐藏或者显示 end --%>
									<c:set var="ruleReduceAddBtnDisplay" value="inline"></c:set><%-- 满减DIV --%>
									<c:if test="${isLimit == 1 }">
										<c:set var="ruleReduceAddBtnDisplay" value="none"></c:set>
									</c:if>
									<%-- 满减规则添加按钮 隐藏或者显示 end --%>
									<%-- 1、满减活动规则块 div begin --%>
									<div id="ruleReduce" style="display: ${ruleReduceDisplay};">
										<div class="item form-group">
											<label class="control-label col-md-1 col-sm-1 col-xs-1" for="" style="padding-right: 0px;"><span class="required"> <font
												color="red">*</font></span>满减规则：</label>
											<div class="col-md-11 col-sm-11 col-xs-11">
												<input type="checkbox" name="isLimit" id="isLimit" <c:if test="${isLimit == 1 }"> checked="true" </c:if> /> <b>上不封顶</b><font color="gray">（“每X元减X元”的倍数自动计算优惠金额）</font>
											</div>
										</div>
										<div class="item form-group">
											<label class="control-label col-md-1 col-sm-1 col-xs-1" for="">&nbsp;</label>
											<div class="col-md-11 col-sm-11 col-xs-11" id="ruleReduceDiv">
												<c:if test="${not empty ruleReduceList }">
													<c:forEach items="${ruleReduceList }" var="ruleReduce" varStatus="r">
														<c:choose>
															<c:when test="${r.index == 0 }">
																<div id="ruleReduceBaseDiv" class="col-md-12 col-sm-12 col-xs-12">
																	<div class="item form-group">
																		<label class="control-label col-md-1 col-sm-1 col-xs-1">订单金额满</label>
																		<div class="col-md-2 col-sm-2 col-xs-2">
																			<input type="text" class="form-control" name="orderMoney" value="<fmt:formatNumber type="number" value="${ruleReduce.orderMoney }" pattern="0.00" maxFractionDigits="2"/>"
																				validate="{required:true,isNoInteger:true}">
																		</div>
																		<label class="control-label col-md-1 col-sm-1 col-xs-1 txtCenter">元，减</label>
																		<div class="col-md-2 col-sm-2 col-xs-2">
																			<input type="text" class="form-control" name="reduceMoney" value="<fmt:formatNumber type="number" value="${ruleReduce.reduceMoney }" pattern="0.00" maxFractionDigits="2"/>"
																				validate="{required:true,isNoInteger:true}">
																		</div>
																		<label class="control-label col-md-1 col-sm-1 col-xs-1 txtLeft">元。</label>
																		<div class="control-label col-md-1 col-sm-1 col-xs-1 txtLeft">
																			<a href="javascript: void(0);" id="reduceAddBtn" onclick="javascript: reduceAdd();"
																				class="glyphicon glyphicon-plus-sign" style="color: green;display:${ruleReduceAddBtnDisplay};"></a>
																		</div>
																	</div>
																</div>
																<div id="ruleReduceAddDiv">
															</c:when>
															<c:otherwise>
																<div id="ruleReduce${r.index}" class="col-md-12 col-sm-12 col-xs-12">
																	<div class="item form-group">
																		<label class="control-label col-md-1 col-sm-1 col-xs-1">订单金额满</label>
																		<div class="col-md-2 col-sm-2 col-xs-2">
																			<input type="text" class="form-control" name="orderMoney${r.index}" value="<fmt:formatNumber type="number" value="${ruleReduce.orderMoney }" pattern="0.00" maxFractionDigits="2"/>"
																				validate="{required:true,isNoInteger:true}">
																		</div>
																		<label class="control-label col-md-1 col-sm-1 col-xs-1 txtCenter">元，减</label>
																		<div class="col-md-2 col-sm-2 col-xs-2">
																			<input type="text" class="form-control" name="reduceMoney${r.index}" value="<fmt:formatNumber type="number" value="${ruleReduce.reduceMoney }" pattern="0.00" maxFractionDigits="2"/>"
																				validate="{required:true,isNoInteger:true}">
																		</div>
																		<label class="control-label col-md-1 col-sm-1 col-xs-1 txtLeft">元。</label>
																		<div class="control-label col-md-1 col-sm-1 col-xs-1 txtLeft">
																			<a href="javascript: void(0);" onclick="javascript: ruleDel('ruleReduce${r.index}');"
																				class="glyphicon glyphicon-minus-sign" style="color: red;"></a>
																		</div>
																	</div>
																</div>
															</c:otherwise>
														</c:choose>
													</c:forEach>
													</div>
												</c:if>
											</div>
										</div>
									</div>
									<%-- 1、满减活动规则块 div end --%>
									<%-- 2、满赠活动规则块 div begin --%>
									<div id="ruleGift" style="display: ${ruleGiftDisplay};">
										<div class="item form-group">
											<label class="control-label col-md-1 col-sm-1 col-xs-1" for="" style="padding-right: 0px;"><span class="required"> <font
												color="red">*</font></span>满赠规则：</label>
											<div class="col-md-11 col-sm-11 col-xs-11" id="ruleGiftDiv">
												<c:if test="${not empty ruleGiftList }">
													<c:forEach items="${ruleGiftList }" var="ruleGift" varStatus="r">
														<c:choose>
															<c:when test="${r.index == 0 }">
																<div id="ruleGiftSetDiv">
																	<div class="item form-group">
																		<div class="col-md-11 col-sm-11 col-xs-11 giftDiv">
																			<div class="item form-group">
																				<label class="control-label col-md-1 col-sm-1 col-xs-1">订单金额满</label>
																				<div class="col-md-2 col-sm-2 col-xs-2">
																					<input type="text" class="form-control" name="orderMoney" value="<fmt:formatNumber type="number" value="${ruleGift.orderMoney }" pattern="0.00" maxFractionDigits="2"/>"
																						validate="{required:true,isNoInteger:true}">
																				</div>
																				<label class="control-label col-md-1 col-sm-1 col-xs-1 txtCenter">元赠：</label>
																			</div>
																			<div class="item form-group">
																				<span id="giftTypeTmp">
																					<input type="radio" name="giftType" value="1" <c:if test="${ruleGift.giftType == 1 }">checked="true"</c:if> validate="{required:true}">&nbsp;<label style="margin-right:50px;">商品</label>
																					<input type="radio" name="giftType" value="2" <c:if test="${ruleGift.giftType == 2 }">checked="true"</c:if> validate="{required:true}">&nbsp;<label style="margin-right:50px;">优惠券</label>
																					<input type="radio" name="giftType" value="3" <c:if test="${ruleGift.giftType == 3 }">checked="true"</c:if> validate="{required:true}">&nbsp;<label style="margin-right:50px;">积分</label>
																				</span>
																			</div>
																			<div class="item form-group">
																				<div id="giftType">
																					<c:choose>
																						<c:when test="${ruleGift.giftType == 1 }">
																							<div class="item form-group">
																								<button type="button" class="btn btn-success btn-sm"
																									onclick="javascript: openProWin('giftTable');">添加商品</button>
																							</div>
																							<div class="item form-group">
																								<table id="giftTable" class="table" title="${promotion.id }#${ruleGift.id }"></table>
																							</div>
																						</c:when>
																						<c:when test="${ruleGift.giftType == 2 }">
																							<div class="item form-group">
																								<div class="col-md-4 col-sm-4 col-xs-4">
																									<%-- <input type="text" name="giftValue" validate="{required:true,isNoInteger:true}" value="<fmt:formatNumber type="number" value="${ruleGift.giftValue }" pattern="0.00" maxFractionDigits="2"/>" class="form-control" placeholder="优惠金额"> --%>
																									<input type="hidden" id="couponId" name="couponId" value="${ruleGift.couponId }" />
																									<select class="selectpicker form-control col-md-12" id="couponCombo" name="couponCombo" title="请选择赠送的优惠券">
																										<option value="">全部</option>
																									</select>
																								</div>
																							</div>
																						</c:when>
																						<c:otherwise>
																							<input type="text" name="giftValue" validate="{required:true,isNoInteger:true}" value="<fmt:formatNumber type="number" value="${ruleGift.giftValue }" pattern="0.00" maxFractionDigits="2"/>" class="form-control txtWidth200" placeholder="输入积分">
																						</c:otherwise>
																					</c:choose>
																				</div>
																			</div>
																		</div>
																		<div class="control-label col-md-1 col-sm-1 col-xs-1 txtLeft">
																			<a href="javascript: void(0);" id="giftAddBtn" onclick="javascript: giftAdd();" class="glyphicon glyphicon-plus-sign" style="color:green;"></a>
																		</div>
																	</div>
																</div>
															</c:when>
															<c:otherwise>
																<div id="ruleGiftSetDiv${r.index }">
																	<div class="item form-group">
																		<div class="col-md-11 col-sm-11 col-xs-11 giftDiv">
																			<div class="item form-group">
																				<label class="control-label col-md-1 col-sm-1 col-xs-1">订单金额满</label>
																				<div class="col-md-2 col-sm-2 col-xs-2">
																					<input type="text" class="form-control" name="orderMoney" value="<fmt:formatNumber type="number" value="${ruleGift.orderMoney }" pattern="0.00" maxFractionDigits="2"/>"
																						validate="{required:true,isNoInteger:true}">
																				</div>
																				<label class="control-label col-md-1 col-sm-1 col-xs-1 txtCenter">元赠：</label>
																			</div>
																			<div class="item form-group">
																				<span id="giftTypeTmp">
																					<input type="radio" name="giftType${r.index }" value="1" <c:if test="${ruleGift.giftType == 1 }">checked="true"</c:if> validate="{required:true}">&nbsp;<label style="margin-right:50px;">商品</label>
																					<input type="radio" name="giftType${r.index }" value="2" <c:if test="${ruleGift.giftType == 2 }">checked="true"</c:if> validate="{required:true}">&nbsp;<label style="margin-right:50px;">优惠券</label>
																					<input type="radio" name="giftType${r.index }" value="3" <c:if test="${ruleGift.giftType == 3 }">checked="true"</c:if> validate="{required:true}">&nbsp;<label style="margin-right:50px;">积分</label>
																				</span>
																			</div>
																			<div class="item form-group">
																				<div id="giftType${r.index }">
																					<c:choose>
																						<c:when test="${ruleGift.giftType == 1 }">
																							<div class="item form-group">
																								<button type="button" class="btn btn-success btn-sm"
																									onclick="javascript: openProWin('giftTable${r.index }');">添加商品</button>
																							</div>
																							<div class="item form-group">
																								<table id="giftTable${r.index }" class="table" title="${promotion.id }#${ruleGift.id }"></table>
																							</div>
																						</c:when>
																						<c:when test="${ruleGift.giftType == 2 }">
																							<%-- <div class="item form-group">
																								<div class="col-md-2 col-sm-2 col-xs-2">
																									<input type="text" name="giftValue${r.index }" validate="{required:true,isNoInteger:true}" value="<fmt:formatNumber type="number" value="${ruleGift.giftValue }" pattern="0.00" maxFractionDigits="2"/>" class="form-control" placeholder="优惠金额">
																								</div>
																								<div class="col-md-1 col-sm-1 col-xs-1">元</div>
																							</div> --%>
																							<div class="item form-group">
																								<div class="col-md-4 col-sm-4 col-xs-4">
																									<%-- <input type="text" name="giftValue" validate="{required:true,isNoInteger:true}" value="<fmt:formatNumber type="number" value="${ruleGift.giftValue }" pattern="0.00" maxFractionDigits="2"/>" class="form-control" placeholder="优惠金额"> --%>
																									<input type="hidden" id="couponId${r.index }" name="couponId" value="${ruleGift.couponId }" />
																									<select class="selectpicker form-control col-md-12" id="couponCombo${r.index }" name="couponCombo" title="请选择赠送的优惠券">
																										<option value="">全部</option>
																									</select>
																								</div>
																							</div>
																						</c:when>
																						<c:otherwise>
																							<input type="text" name="giftValue${r.index }" validate="{required:true,isNoInteger:true}" class="form-control txtWidth200" value="<fmt:formatNumber type="number" value="${ruleGift.giftValue }" pattern="0.00" maxFractionDigits="2"/>" placeholder="输入积分">
																						</c:otherwise>
																					</c:choose>
																				</div>
																			</div>
																		</div>
																		<div class="control-label col-md-1 col-sm-1 col-xs-1 txtLeft">
																			<a href="javascript: void(0);" onclick="javascript: ruleDel('ruleGiftSetDiv${r.index }');" class="glyphicon glyphicon-minus-sign" style="color:red;"></a>
																		</div>
																	</div>
																</div>
															</c:otherwise>
														</c:choose>
													</c:forEach>
												</c:if>
											</div>
										</div>
									</div>
									<%-- 2、满赠活动规则块 div end --%>
									<%-- 3、折扣活动规则块 div begin --%>
									<div id="ruleDiscount" style="display: ${ruleDiscountDisplay};">
										<div class="item form-group">
											<label class="control-label col-md-1 col-sm-1 col-xs-1" for="" style="padding-right: 0px;"><span class="required"> <font
												color="red">*</font></span>折扣规则：</label>
											<div class="col-md-11 col-sm-11 col-xs-11" id="ruleDiscountDiv">
												<c:if test="${not empty ruleDiscountList }">
													<c:forEach items="${ruleDiscountList }" var="ruleDiscount" varStatus="r">
														<c:choose>
															<c:when test="${r.index == 0 }">
																<div id="ruleDiscountBaseDiv" class="col-md-12 col-sm-12 col-xs-12">
																	<div class="item form-group">
																		<label class="control-label col-md-1 col-sm-1 col-xs-1">订单金额满</label>
																		<div class="col-md-2 col-sm-2 col-xs-2">
																			<input type="text" class="form-control" name="orderMoney" value="<fmt:formatNumber type="number" value="${ruleDiscount.orderMoney }" pattern="0.00" maxFractionDigits="2"/>"
																				validate="{required:true,isNoInteger:true}">
																		</div>
																		<label class="control-label col-md-1 col-sm-1 col-xs-1 txtCenter">元，打</label>
																		<div class="col-md-2 col-sm-2 col-xs-2">
																			<input type="text" class="form-control" name="discount" value="<fmt:formatNumber type="number" value="${ruleDiscount.discount }" pattern="0.00" maxFractionDigits="2"/>"
																				validate="{required:true,isNoInteger:true}">
																		</div>
																		<label class="control-label col-md-1 col-sm-1 col-xs-1 txtLeft">折。</label>
																		<div class="control-label col-md-1 col-sm-1 col-xs-1 txtLeft">
																			<a href="javascript: void(0);" id="discountAddBtn" onclick="javascript: discountAdd();"
																				class="glyphicon glyphicon-plus-sign" style="color: green;"></a>
																		</div>
																	</div>
																</div>
															</c:when>
															<c:otherwise>
																<div id="ruleDiscount${r.index}" class="col-md-12 col-sm-12 col-xs-12">
																	<div class="item form-group">
																		<label class="control-label col-md-1 col-sm-1 col-xs-1">订单金额满</label>
																		<div class="col-md-2 col-sm-2 col-xs-2">
																			<input type="text" class="form-control" name="orderMoney${r.index}" value="<fmt:formatNumber type="number" value="${ruleDiscount.orderMoney }" pattern="0.00" maxFractionDigits="2"/>"
																				validate="{required:true,isNoInteger:true}">
																		</div>
																		<label class="control-label col-md-1 col-sm-1 col-xs-1 txtCenter">元，打</label>
																		<div class="col-md-2 col-sm-2 col-xs-2">
																			<input type="text" class="form-control" name="discount${r.index}" value="<fmt:formatNumber type="number" value="${ruleDiscount.discount }" pattern="0.00" maxFractionDigits="2"/>"
																				validate="{required:true,isNoInteger:true}">
																		</div>
																		<label class="control-label col-md-1 col-sm-1 col-xs-1 txtLeft">折。</label>
																		<div class="control-label col-md-1 col-sm-1 col-xs-1 txtLeft">
																			<a href="javascript: void(0);" onclick="javascript: ruleDel('ruleDiscount${r.index}');"
																				class="glyphicon glyphicon-minus-sign" style="color: red;"></a>
																		</div>
																	</div>
																</div>
															</c:otherwise>
														</c:choose>
													</c:forEach>
												</c:if>
											</div>
										</div>
									</div>
									<%-- 3、折扣活动规则块 div end --%>
									<!-- 活动规则模块 end -->
								</form>
								<div class="ln_solid"></div>
								<div class="form-btn-content txtLeft">
									<a id="btnSavePromotion" class="btn btn-primary" onclick="javascript: savePromotion();">保存</a> <a id="btn_back"
										class="btn btn-default">返回</a>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>




<%-- 添加活动对象弹出层 begin --%>
<div class="modal fade" id="targetModal" tabindex="-1" data-backdrop="static" role="dialog" aria-labelledby="targetModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width: 70%;min-height:450px;height:500px;max-height:500px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="targetModalLabel">选择活动对象</h4>
			</div>
			<div class="modal-body">
				<div class="row">
					<div class="col-md-3 col-sm-3 col-xs-3 txtCenter txtSize16">
						<!-- <b>活动对象类型</b> -->
						<a href="javascript: void(0);" class="btn btn-xs btn-success" style="margin-bottom:10px;" onclick="javascript: doSelectedTargetAll();">选中全部属性</a>
					</div>
					<div class="col-md-3 col-sm-3 col-xs-3 txtCenter txtSize16">
						<b>活动对象值</b>
					</div>
					<div class="col-md-6 col-sm-6 col-xs-6 txtCenter txtSize16">
						<!-- <b>已选中的活动对象</b> -->
						<a class="btn btn-xs btn-danger" style="margin-bottom:10px;" onclick="javascript: $('#choseTargetDiv ul').html('');loadPromotionTargetProperties();">清空选中对象</a>
					</div>
				</div>
				<div class="row">
					<div class="col-md-3 col-sm-3 col-xs-3">
						<select class="col-md-12" size="10" id="promotionTargetTypeCombo">
							<option value="0">客户级别</option>
						</select>
					</div>
					<div class="col-md-3 col-sm-3 col-xs-3" id="targetsDiv" style="border: 1px #ddd solid;height:302px;padding-top: 10px;overflow-y:auto;">
					</div>
					<div class="col-md-6 col-sm-6 col-xs-6 target" id="choseTargetDiv" 
						style="border: 1px #ddd solid;word-wrap: normal;margin-top:0px;height:302px;padding-top: 10px;overflow-y:auto;">
						<div class="selectedTargetDiv">
							<dl class="selectedTargetDL" style="border-bottom: none;">
								<dd>
									<ul class="selectedTargetUL">
									</ul>
								</dd>
							</dl>
						</div>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary" onclick="javascript: doGetTarget();">确定</button>
			</div>
		</div>
	</div>
</div>
<%-- 添加活动对象弹出层 begin --%>

<%-- 添加商品弹出层 begin --%>
<div class="modal fade" id="productModal" tabindex="-1" data-backdrop="static" role="dialog" aria-labelledby="productModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width: 70%;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="productModalLabel">选择商品</h4>
			</div>
			<div class="modal-body">
				<div class="row" style="padding-bottom: 10px;">
					<div class="col-md-4">
						<input type="text" class="form-control col-md-12" id="productName" id="productName" placeholder="请输入商品名称" maxlength="50" /> 
						<input type="hidden" name="type" id="type" value="category">
						<input type="hidden" name="tableId" id="tableId" value="productTable">
					</div>
					<div class="col-md-4">
						<button type="button" class="btn btn-danger" onclick="javascript: reloadProTable();">搜索</button>
					</div>
					<div class="col-md-4" style="text-align: right;">
						<div class="switch" oncolor="success" offcolor="warning" ontext="类型" offtext="品牌">
							<div class="bootstrap-switch bootstrap-switch-wrapper bootstrap-switch-animate bootstrap-switch-on"
								style="width: 106px;">
								<div class="bootstrap-switch-container" style="width: 156px; margin-left: 0px;">
									<span id="onCategory" class="bootstrap-switch-handle-on btn-danger" style="width: 52px;"
										onclick="javascript: showCategory();">类型</span> <span id="onBrand" class="bootstrap-switch-handle-off"
										style="width: 52px;" onclick="javascript: showBrand();">品牌</span>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="row" >
					<div class="col-md-6 col-sm-6 col-xs-6">
						<!-- 品类选择 end -->
						<div class="row" id="proCategoryDiv">
							<div class="col-md-6 col-sm-6 col-xs-6">
								<select class="col-md-12" size="10" id="category" name="category"
									onchange="javascript: loadCategorySelectedOptions('childCategory', $('#category option:selected').val()); reloadProTable();">
								</select>
							</div>
							<div class="col-md-6 col-sm-6 col-xs-6">
								<select class="col-md-12" id="childCategory" name="childCategory" size="10"
									onchange="javascript: reloadProTable();">
									<option value="">全部</option>
								</select>
							</div>
						</div>
						<!-- 品类选择 end -->
						<!-- 品牌选择 begin -->
						<div class="row" id="proBrandDiv" style="display: none;">
							<div class="col-md-6 col-sm-6 col-xs-6">
								<select class="col-md-12" size="10" id="brandCode" name="brandCode"
									onchange="javascript: loadBrandSelectOptions('childBrandCode', $('#brandCode option:selected').val()); reloadProTable();">
								</select>
							</div>
							<div class="col-md-6 col-sm-6 col-xs-6">
								<select class="col-md-12" size="10" id="childBrandCode" name="childBrandCode" onchange="javascript: reloadProTable();">
									<option value="">全部</option>
								</select>
							</div>
						</div>
						<!-- 品牌选择 end -->
					</div>
					<div class="col-md-6 col-sm-6 col-xs-6">
						<table id="proTable" class="table"></table>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary" onclick="javascript: doGetProduct();">确定</button>
			</div>
		</div>
	</div>
</div>
<%-- 添加商品弹出层 end --%>
</body>
<script type="text/javascript" src="<%=basePath%>/statics/js/jquery.form.js"></script>
<script type="text/javascript" src="<%=basePath%>/statics/js/jquery.validate.js"></script>
<script type="text/javascript" src="<%=basePath%>/statics/js/jquery.metadata.js"></script>
<script type="text/javascript" src="<%=basePath%>/statics/plugins/bootstrap-daterangepicker/moment.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/statics/plugins/bootstrap-daterangepicker/daterangepicker.js"></script>
<script type="text/javascript" src="<%=basePath%>/js/promotion/promotion_form.js?v=<%=new java.util.Date().getTime() %>"></script>
</html>